<?php $this->load->view('common/head');?>
    <form class="form-inline" action="<?php echo $this->input->server('REQUEST_URI'); ?>" method="post" enctype="multipart/form-data" id="fileAdd" name="fileAdd">
      <input type="hidden" name="id" id="id" value="<?=isset($fileData) ? $fileData['id'] : ''?>">
      <table class="table ">
        <thead>
          <tr>
            <th colspan="2" class="text-center">文件信息</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td><label for="year" class="control-label">文件名称：</label></td>
            <td class="text-left">
                <input type="input" class="form-control" style="width:300px;" name="title" id="title" value="<?=isset($fileData) ? $fileData['title'] : ''?>" placeholder="文件名称"> 
            </td>
          </tr>
          <tr>
            <td><label for="inputFile" class="control-label">上传文件:</label></td>
            <td class="text-left">
              <span id="fileUploadDownload">
                <?php if ($fileData['fileId']) {?>
                <a type="button" class="btn btn-default" href="<?=printUrl('Upload','download',array('fileId'=>$fileData['fileId']))?>" aria-label="Left Align" role="button">
                  <span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>
                  附件下载
                </a>
                <?php } ?>
              </span>
                <input type="hidden" id="fileUploadFileId" name="fileId" value="<?=$fileData['fileId']?>" readonly="readonly">
                <input type="button" id="fileUpload" value="上传" />
            </td>
          </tr>
          <tr>
            <td colspan="2" class="text-center">
              <button type="button" class="btn btn-default btn-primary" role="button" onclick="ajaxFormSubmit('fileAdd')">保存</button>
            </td>
            <td></td>
          </tr>
        </tbody>
      </table>
    </form>
<?php initUploadButtons(array('fileUpload'), printUrl('Upload','uploadSave',array('dir'=>'file')), 'imgFile'); ?>
<?php $this->load->view('common/foot');?>